package imnu.work_05.work_3.oop;

/**
 * @author: lys
 * @类名: Circle
 * @Title:
 * @date: 2020/7/17
 **/
public class Circle extends Shape {
    //定义属性
    private double radius;

    //构造函数
    public Circle() {
    }
    public Circle(String color, double radius) {
        super(color);
        this.radius = radius;
    }
    //重写方法
    @Override
    public void showAll() {
        System.out.println("面积："+String.format("%.2f",area)+"\t周长："+String.format("%.2f",per)+"\t颜色："+color);
    }

    @Override
    public void getArea() {
        area = 3.14*radius*radius;
    }

    @Override
    public void getPer() {
        per = 2*3.14*radius;
    }

}
